package com.milkshopbackend.milkshop.entity;

import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class ProductDTO {
    private Long id;

    @NotBlank(message = "商品名称不能为空")
    private String name;

    private String description;

    @NotNull(message = "商品价格不能为空")
    @Positive(message = "商品价格必须为正数")
    private BigDecimal price;

    @NotBlank(message = "商品图片不能为空")
    private String image;

    @NotNull(message = "商品库存不能为空")
    @Positive(message = "商品库存必须为正数")
    private Integer stock;

    private Boolean status;

    private Long categoryId;

    private String specName;

    private Integer rating;    // 商品评分

    private Integer sales;     // 商品销量

    private LocalDateTime createTime;

    private LocalDateTime updateTime;
}
